import {resolve} from 'path'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
  ],
  resolve: {
    alias: {
      "@":resolve(__dirname,'./src'),
      "@store":resolve(__dirname,'./src/stores'),
      "@router":resolve(__dirname,'./src/router'),
      "@ulits":resolve(__dirname,'./src/ulits'),
      "@api":resolve(__dirname,'./src/api'),
      "@public":resolve(__dirname,'./public'),
    }
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://localhost:3000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''),
      },
    },
  },
})
